//
//  StatusesBottomView.swift
//  新浪微博
//
//  Created by mac on 15/12/1.
//  Copyright © 2015年 mac. All rights reserved.
//

import UIKit
import SnapKit

class StatusesBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
    self.backgroundColor = UIColor(white: 08, alpha: 1)
        addSubview(retweetedBtn)
        addSubview(commentBtn)
        addSubview(likeBtn)
        //布置布局
        retweetedBtn.snp_makeConstraints { (make) -> Void in
            make.left.top.bottom.equalTo(self)
        }
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetedBtn.snp_right)
            make.top.bottom.equalTo(self)
            make.width.equalTo(retweetedBtn.snp_width)
        }
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(commentBtn.snp_right)
            make.right.equalTo(self.snp_right)
            make.top.bottom.equalTo(self)
            make.width.equalTo(commentBtn.snp_width)
            
        }
        let view1 = sepView()
         addSubview(view1)
        let view2 = sepView()
        addSubview(view2)
        let w = 0.5
        let scale = 0.4
        //设置分割线布局
        view1.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(retweetedBtn.snp_right)
            make.width.equalTo(w)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
        }
        view2.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(commentBtn.snp_right)
            make.width.equalTo(w)
            make.centerY.equalTo(self.snp_centerY)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
        }

    }
   
    
    
    private func sepView() -> UIView {
        let v = UIView()
        v.backgroundColor = UIColor.darkGrayColor()
        return v
    }
    //懒加载视图
    private lazy var retweetedBtn: UIButton = UIButton(title: "转发", backImage: nil, color: UIColor.grayColor(), fontSize: 10, isNeedHighlighted: false, imageName: "timeline_icon_retweet")
    
    private lazy var commentBtn: UIButton = UIButton(title: "评论", backImage: nil, color: UIColor.grayColor(), fontSize: 10, isNeedHighlighted: false, imageName: "timeline_icon_comment")
    
    private lazy var likeBtn: UIButton = UIButton(title: "点赞", backImage: nil, color: UIColor.grayColor(), fontSize: 10, isNeedHighlighted: false, imageName: "timeline_icon_unlike")
    
    }
